<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class Partner extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'source_name'=>'required',
            'contact_name'=>'required',
            'contact_tel' => ['required','regex:/^((13[0-9])|(15[^4])|(166)|(17[0-8])|(18[0-9])|(19[8-9])|(147)|(145))\\d{8}$/'],

        ];
    }

    public function messages()
    {
        return [
            'source_name.required'=>'请输入资源名称',

            'contact_name' =>'请输入联系人姓名',

            'contact_tel.required' => '请输入联系方式',
            'contact_tel.regex' => '手机号格式错误',
        ];
    }
}
